{
  "properties" : { },
  "id" : "copy1730623597392d47881",
  "script" : null,
  "groupId" : "09cead823dff4c70b2f24035bd170cf5",
  "name" : "抓取网站中的内容",
  "createTime" : null,
  "updateTime" : 1732682202316,
  "lock" : null,
  "createBy" : null,
  "updateBy" : "可辉",
  "path" : "zqwz_link",
  "method" : "GET",
  "parameters" : [ ],
  "options" : [ ],
  "requestBody" : "",
  "headers" : [ ],
  "paths" : [ ],
  "responseBody" : "{\n    \"code\": 200,\n    \"msg\": \"success\",\n    \"data\": 1\n}",
  "description" : null,
  "requestBodyDefinition" : null,
  "responseBodyDefinition" : null
}
================================
import org.openqa.selenium.OutputType
import org.openqa.selenium.By
import org.openqa.selenium.WebElement
import org.openqa.selenium.firefox.FirefoxOptions
import org.openqa.selenium.firefox.FirefoxProfile
import org.openqa.selenium.firefox.FirefoxDriver
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.Cookie
import org.ssssssss.magicapi.utils.IoUtils
import com.wiwf.model.manage.utils.SeleniumUtil;
import java.io.File
import response
import http;
import log;


var page = 1;
var limit = 20;
var offset = (page-1)*limit;
var resData = db.table('ct_acggame').where().lt('id',856).orderBy('id','DESC').page(limit, offset);

FirefoxDriver driver = SeleniumUtil.getFoxDriver("/data/spider/file/geckodriver.exe");

for (obj in resData.list) {
    var url = obj.page;
log.info(url)
        // -- 访问
        driver.get(url);
        
        // -- 动作
        weAct = new Actions(driver);
            //
            driver.executeScript(
                'window.scrollTo(0,3000)',driver.findElementsByTagName('body'));
        // -- 动作 结束
        weAct.perform();
        
        // -- 取元素 
        var wes = driver.findElements(By.xpath('//*[@id="content"]/main/div[1]/div/div[1]/div/div[2]/p'));

        var qumText = '';
        var baiduText = '';
        for (webObj in wes) {
            String text = webObj.getText();
            if(text.startsWith('提取码：') || text.startsWith('取码：')){
                qumText = text.split('：')[1];
            }
            if(text.startsWith('提取码: ') || text.startsWith('取码: ')){
                qumText = text.split(' ')[1];
            }
            
            if(text.startsWith('百链接') || text.startsWith('百度网盘') || text.startsWith('度盘')){
                text = text.replaceAll('删除', '');
                text = text.replaceAll('删掉', '');
                baiduText = text.split('https://')[1];
            }
        }
    obj.link1 = baiduText+'?pwd='+qumText;
    log.info(obj.link1);
    db.table('ct_acggame').primary('id').update(obj, false);
}

return 1;